<div id="wrap">
    <h1><?php echo $this->title; ?></h1>
    <div class="statisticsNav">
        <div class="subject">
            <h1>分数区间</h1>
            <ul>
                <?php if(!empty($scoreArray)): ?>
                <?php   foreach($scoreArray as $val): ?>
                <li><?php echo $val['name']; ?></li>
                <?php   endforeach; ?>
                <?php endif; ?>
            </ul>
        </div>
        <p style="clear:both;"></p>
    </div>
    <div class="clearfix">
    	<div id="statisticsChart"></div>
    </div>
    <div class="clearfix">
    	<input type="submit" value="导出" name="submit" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor fr mr20 mt10 import_list" />
    </div>
    <div id="statisticsTABLE">
        <table class="fontc_666 height32" align="center" valign="middle" border="0" cellpadding="0" cellspacing="0" width="100%">
            <thead class=" fontc_999" bgColor="#4e98bd" style="color:#fff;">
                <tr height="38">
                    <th width="150" align="center" valign="middle" class="border_d"><span style="padding:0 5px;">学校</span></th>
                    <th width="" align="center"  valign="middle" class="border_d"><span style="padding:0 5px;">人数</span></th>
                    <?php echo $table2; ?>
                </tr>
            </thead>
            <tbody style="background:#fff;">
                <?php echo $table3; ?>
                <tr height="38">
                    <th width="150" align="center" valign="middle" class="border_d"><span style="padding:0 5px;">合计</span></th>
                    <?php echo $table6; ?>
                </tr>    
            </tbody>
        </table>
    </div>
</div>
<?php $n_photo_array = array(); $n_photo_array['dataNum'] = isset($dataNum_photo[0])?$dataNum_photo[0]:array();  ?>
<script>
    $(function(){
        var data = <?php echo json_encode($n_photo_array+$new_photo_data); ?>;
        var new_data = <?php echo json_encode($new_photo_data); ?>;
        var d_data = <?php echo json_encode($dataNum_photo); ?>;
        YUEchart.rangeChart( $("#statisticsChart"),data );
        $(".subject ul li" ).click(function(){
            $(this).addClass("on").siblings().removeClass( "on" );
            var school_i= $(this).index();
            var k = parseInt(school_i)+parseInt(1);
            var d = new_data;
            d.dataNum=d_data[k];
            YUEchart.rangeChart( $("#statisticsChart"),d );
        });
        
        var exam_id = '<?php echo $exam_id; ?>';
        var school_id = '<?php echo $school_id; ?>';
        
        //导出相关数据
        $(".import_list").click(function(){
           $.get('/st/default/import_interval', {exam_id: exam_id,school_id: school_id}, function(data) {
                if(data==1){
                    $.dialog.alert('导出数据不存在');
                }else{
                    window.location.href = '<?php echo $this->createUrl('/st/default/import_interval'); ?>/exam_id/<?php echo $exam_id; ?>/school_id/<?php echo $school_id; ?>';
                }
                return false;
            });
        });
        
    });
</script>
<div style="display: none;"></div>